home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pavt150.zip / PAVT150.DOC < prev    next >
Text File  |  1993-04-12  |  29KB  |  612 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                                   PAvatar 1.50
  21.  
  22.                      Turbo Pascal Avatar level 1 Console Kit
  23.  
  24.                       Copyright 1991 - 93 Gregory P. Smith
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.         Part I.  Introduction
  33.         ──────────────────────────────────────────────────────────────────
  34.         
  35.              This  toolkit  represents hundreds of hours  of  programming 
  36.         that  resulted in this fast and accurate product.  PAvatar  is  a 
  37.         Turbo  Pascal  unit (versions 5.5 - 7.0) that  can  provide  your 
  38.         programs  with Avatar level 1 console, Avatar level 0+  (optional 
  39.         ANSI  fallback), ANSI-BBS,  ANSI, and VT-52 terminal  emulations.  
  40.         Procedural  hooks  are used for screen I/O  and  cursor  control, 
  41.         allowing  you  to use the procedures of your choice,  making  the 
  42.         unit the most flexible of its type.
  43.              An added bonus to using this unit is multitasker  awareness.  
  44.         The  PAvtIO  unit  contains facilities  for  detecting  DESQview, 
  45.         giving up the time slice to any multitasker, and using DESQview's 
  46.         video & sound buffers.  This is especially valuable for  communi-
  47.         cations and BBS programs that are often run under multitaskers.
  48.         
  49.         Requirements
  50.         ─────────────────────────
  51.         
  52.              This unit requires a Turbo Pascal 5.5, 6.0, or 7.0  compiler 
  53.         running  on an IBM or compatible computer.  I have  used  objects 
  54.         for fast and efficient data management within this unit; I cannot 
  55.         provide a Turbo Pascal version 5.0 unit.
  56.              Memory requirements within a program using PAvatar have been 
  57.         kept  to  a minimum.  Only 3k of heap space and 500  bytes  stack 
  58.         space  are required.  The actual code itself requires  less  than 
  59.         18k.
  60.         
  61.         Shareware
  62.         ─────────────────────────
  63.         
  64.              I  am distributing this unit under a relaxed shareware  con-
  65.         cept  in order to promote Avatar.  You are free to use  the  com-
  66.         piled unit however you want, as long as I am given credit for the 
  67.         terminal  emulations  somewhere in the documentation  or  in  the 
  68.         program  itself.   Please let me know of any  programs  that  you 
  69.         write using PAvatar so that I can recommend them to others.
  70.              If  you  want PAvatar source code it is  available  for  $12 
  71.         U.S.,  see  the registration form for details.  The  source  code 
  72.         allows  you  to exclude many options that you may  not  need  via 
  73.         compiler defines (making the code much smaller).
  74.         
  75.         Liability
  76.         ─────────────────────────
  77.         
  78.              To  use PAvatar you must first agree that I cannot  be  held 
  79.         responsible  for any damages or problems that occur from its  use 
  80.         or  misuse.   If you do not agree to these terms don't  use  this 
  81.         unit.
  82.         
  83.         Part II.  QUICK START
  84.         ──────────────────────────────────────────────────────────────────
  85.         
  86.              First you must install the unit.  To do so, copy the  appro-
  87.         priate  TPU file into your units directory (the TPU's  have  been 
  88.         renamed  according  to the compiler version they will  work  with 
  89.         (.T55  for TP 5.5, .T70 for TP 7.0, etc.) you must rename  yours.  
  90.         Next, copy the demo program PAVTDEMO.PAS into your Pascal  direc-
  91.         tory.  Type TPC pavtdemo or compile it to disk from the IDE.  You 
  92.         now  have a utility for displaying AVT/1, AVT/0+, and ANSI  files 
  93.         that is DESQview aware.  
  94.              Unless you're a SysOp, you probably don't have lots of  .AVT 
  95.         Avatar  files.   As of this writing TheDraw 4.60  has  just  been 
  96.         released with support for Avatar level 0 files.  I haven't tested 
  97.         it thoroughly but it appears to create good files.  You may  also 
  98.         use  my  ANSI  to Avatar/0+ converter  to  create  Avatar  files.  
  99.         ANS2AVT  will convert less common ANSI commands and use level  0+ 
  100.         codes.   It's  found on BBS's as A2AVTnnn.ZIP where  nnn  is  the 
  101.         version  number  (currently 2.10).  Please note that  my  ANS2AVT 
  102.         program is now public domain and no longer supported.
  103.         
  104.         Part III.  Interface
  105.         ──────────────────────────────────────────────────────────────────
  106.         
  107.         Procedures
  108.         ─────────────────────────
  109.         
  110.              The PAvt150 Unit:
  111.         ─────────────────────────
  112.         
  113.              PAvatar  is  a self sufficient unit in that  only  two  pro-
  114.         cedures  are required to add an Avatar or ANSI terminal  to  your 
  115.         program.   However, there are more than two procedures  available 
  116.         so  that you can take advantage of many special features  of  the 
  117.         unit.  The procedures and definitions follow.
  118.         
  119.         Procedure InitUnit;
  120.         
  121.              New  with  version 1.50 of PAvatar is  support  for  partial 
  122.         overlaying  of  the code.  This procedure MUST be  called  before 
  123.         your  program  uses  any routines from the  PAvatar  unit!   Your 
  124.         program will most likely lock up if you use PAvatar before it  is 
  125.         initialized.
  126.         
  127.         Procedure Parse_AVT1 (ch:char);
  128.         
  129.              This is the main procedure of the unit.  It takes  character 
  130.         ch and parses it according to the terminal status.  For  instance 
  131.         if  you pass it a ^V it would go into the Avatar command mode  in 
  132.         which  the next character would represent an Avatar command.   If 
  133.         it were an Esc and ANSI was enabled, the next character passed to 
  134.         it  would  be tested for a bracket '[' or a shorter  VT-52  style 
  135.         command.  This is the heart of the whole unit.
  136.         
  137.         Procedure ResetTerminal (nc,nl:byte);
  138.         
  139.              This procedure is used to Reset the Terminal emulation  with 
  140.         screen  dimensions nc columns and nl lines.  It always takes  you 
  141.         back to the original mode with AVT/1 active, ANSI fallback turned 
  142.         off, and the cursor at the home position.  It has the same effect 
  143.         as issuing a ^V^R to the AVT/1 parser.
  144.  
  145.         Procedure SetTerminal(t:TerminalType);
  146.         
  147.              This is the best way to change the type of terminal that the 
  148.         PAvatar unit is emulating.  By passing one of the TermXXXX  typed 
  149.         constants  described  below as a parameter you can  select  which 
  150.         terminal emulation to use.
  151.         
  152.              TerminalType = 
  153.                (TermTTY,   { TTY: no special emulation }
  154.                TermANSI,   { ANSI: extended ANSI }
  155.                TermAVT0,   { AVT/0+: extended level 0+ w/ANSI fallback }
  156.                TermAVT1,   { AVT/1: full level 1 }
  157.                TermVT52);  { VT-52: Standard VT-52 }
  158.         
  159.         
  160.         Procedure SetScreenSize(nc,nl:byte);
  161.         
  162.              Use  this procedure when you want to change the size of  the 
  163.         terminal  screen  without  resetting everything else  as  in  the 
  164.         ResetTerminal procedure.  The only effect this has is  redefining 
  165.         all of the Avatar windows to have nc columns and nl lines.
  166.         
  167.         Procedure AvtTTY (ch:char);
  168.         
  169.              This procedure is called by the AVT/1 Parser when a  charac-
  170.         ter is not part of a control code.  It simply writes character ch 
  171.         to the screen following the current Avatar window setup  (includ-
  172.         ing flow, insert, direction, etc..).  The only characters that it 
  173.         processes are CR, LF, BS, Tab, and Bell.
  174.         
  175.         Function In_Command: Boolean;
  176.         
  177.              Returns a true value if the interpreter is in the middle  of 
  178.         processing any Avatar, ANSI, or VT-52 command.  This is useful to 
  179.         prevent  strange displays or invalid commands when  aborting  the 
  180.         display of a file.
  181.         
  182.         Procedure UpdateCursor(x,y:byte);
  183.         
  184.              This procedure is used to update the cursor position  within 
  185.         the current Avatar window to x,y.  Passing a 0 for either parame-
  186.         ter  will leave that parameter unchanged, but the cursor will  be 
  187.         reset   to  the  correct  position  stored  internally   by   the 
  188.         parser.
  189.         
  190.              The PAvtSnd Unit:
  191.         ─────────────────────────
  192.         
  193.         Procedure AvtSound (note:byte; oct:shortint; dur:byte);
  194.         
  195.              This procedure is a shortcut to stuff music into the  Avatar 
  196.         sound buffer without having to send the code to the parser.  Note 
  197.         represents the musical note in the same method which AVT/1's ^V^S 
  198.         command  uses it.  The note is equal to (tone - 'A') * 2 +  sharp 
  199.         where tone is somewhere between 'A' and 'G' and sharp is a 0 or a 
  200.         1  as the case may be.  A pause is generated by a note of  14  or 
  201.         greater.   oct is a signed integer where 0 represents the  middle 
  202.         octave,  1 the next highest, and -1 the next lowest.  Dur is  the 
  203.         duration of the note in tenths (actually 1/9ths) of a second.  If 
  204.         two  identical  notes are queued in a row, they  will  be  played 
  205.         legato so that they run together.
  206.         
  207.         Procedure ANSISound (note:byte; oct:byte; ticks:byte);
  208.         
  209.              This procedure is similar to AvtSound.  The only differences 
  210.         are  as follows.  Oct is the octave as used by ANSI music  (3  is 
  211.         the middle octave).  Ticks is the number of timer ticks the  note 
  212.         will play for (a timer tick is approximately 1/18th of a second).
  213.         
  214.         Procedure StuffSound (frq,dur:integer);
  215.         
  216.              This procedure is called by the above two procedures.  It is 
  217.         used  to place a sound of frq hertz and dur timer ticks into  the 
  218.         Sound buffer.  If the buffer is full, it will wait until space is 
  219.         available.
  220.         
  221.         Procedure Set_Sound_backg(backg:Boolean);
  222.         
  223.              All sounds produced by the PAvt unit, including the ^G bell, 
  224.         will  be made in the background if backg is set to true.   Other-
  225.         wise  they will be made in the foreground, delaying  the  program 
  226.         until  they finish.  Sound defaults to the foreground, but  there 
  227.         is usually no reason that you shouldn't set it to background.  It 
  228.         is  worth noting, however, that with foreground sound  the  timer 
  229.         interrupt  ($1c) is not chained and/or DESQview sound  calls  are 
  230.         not made.  Sound lengths under multitaskers can be unreliable  if 
  231.         sounds are produced in the foreground.
  232.         
  233.         Procedure Flush_Sound;
  234.         
  235.              This  will stop any sounds from playing and empty the  sound 
  236.         queue.
  237.         
  238.         Function Sounds_Left: integer;
  239.         
  240.              Sounds_Left will return the number of items (sounds &  paus-
  241.         es) left in the sound queue waiting to be played.
  242.         
  243.         Procedure Sound_Finish;
  244.         
  245.              This  procedure makes use of the previous one.  It will  not 
  246.         return to it's caller until all sounds in the queue have finished 
  247.         playing.
  248.         
  249.         Procedure SoundBell;
  250.         
  251.              This  stuffs  a bell sound into the sound buffer.   The  TTY 
  252.         processor uses this when a ^G character is received.
  253.         
  254.         Procedure Sound2(freq:word);
  255.         Procedure NoSound2;
  256.         
  257.              These  routines  are identical to the Crt  units  Sound  and 
  258.         NoSound  procedures  but will generate the sound on an  AdLib  or 
  259.         compatible sound card if one is present.
  260.         
  261.              The PAvtIO Unit:
  262.         ─────────────────────────
  263.         
  264.         Function DESQview_version: word;
  265.         
  266.              This  is  the first of the DESQview supportive  routines  in 
  267.         this  unit.   The DESQview major version number is  in  the  high 
  268.         byte,  while  the minor version is in the low byte.   A  zero  is 
  269.         returned if DESQview is not loaded.
  270.         
  271.         Procedure IdlePause;
  272.         
  273.              This  procedure will give up the current time slice if  your 
  274.         program is running under a multitasker.  Use this procedure  when 
  275.         your  program  is not doing anything to give the  other  programs 
  276.         more processing time.  
  277.         
  278.         Function ReadKey: char;
  279.         
  280.              This is a replacement for the Crt unit's ReadKey that  gives 
  281.         up processor time to a multitasker (via IdlePause) until a key is 
  282.         pressed.  
  283.         
  284.         Procedure DelayTicks(t:word);
  285.         
  286.              This  will delay for t timer ticks.  The accuracy,  however, 
  287.         can only be guaranteed to be within one timer tick.
  288.         
  289.         Procedure DV_Sound(freq,dur:word);
  290.         
  291.              A sound of freq Hz and dur timer ticks will be stuffed  into 
  292.         the background sound buffer provided by DESQview.
  293.         
  294.         Variables
  295.         ─────────────────────────
  296.         
  297.              There  are only a few non-procedural variables that you  can 
  298.         use to check or modify the status of the terminal.  They are  all 
  299.         static variables with defined defaults.  All variable definitions 
  300.         are contained in the PAvtIO unit.
  301.         
  302.         ANSI_BBS : Boolean = True;
  303.         
  304.              Use  this variable to decide whether PAvatar's  ANSI  inter-
  305.         preter will use BBS/DOS style ANSI.  When it is true Esc[2J homes 
  306.         the  cursor when it clears the screen and Esc[J acts the same  as 
  307.         Esc[2J instead of Esc[0J.  DOS's own ANSI.SYS works in this way.
  308.         
  309.         ANSI_MUSIC : Boolean = True;
  310.         
  311.              When  this  variable is true "ANSI" music commands  will  be 
  312.         processed.  It is recommended that sound be set to background  if 
  313.         you wish to support music.
  314.  
  315.         In_DV : Boolean = <see text>;
  316.         
  317.              This  variable is initialized in the PAvtIO unit.  If it  is 
  318.         true  the  DESQview multitasker has  been  detected.   Background 
  319.         sounds  will be produced using DESQview specific calls.
  320.         
  321.         CurrentTerm : TerminalType = TermAVT1;
  322.         
  323.              This variable is set by the SetTerminal procedure to identi-
  324.         fy the currently active emulation.  It should not be modified; it 
  325.         is for reference only.
  326.         
  327.         Sound_Stat : byte = 3;
  328.         
  329.              This  variable is used to control which sounds are  produced 
  330.         by the unit.  If bit 1 is set then the unit can make sounds.  Bit 
  331.         0 only controls the bell (^G) sound.  As you can see, the default 
  332.         is to have all sound enabled.
  333.         
  334.         IgnoreNULL : Boolean = False;
  335.         
  336.              Used  by the VT-52 terminal, this variable will  cause  null 
  337.         (#0) characters to be ignored by the TTY processor.
  338.         
  339.         VT52On : Boolean = False;
  340.         
  341.              When  true and in ANSI mode, commands will be treated  as  a 
  342.         VT-52  terminal  would treat them.  ANSI commands which  are  not 
  343.         overridden by a VT-52 command will remain effective.
  344.         
  345.         Fallback : Boolean = False;
  346.         
  347.              This  variable  controls whether ANSI fallback  will  be  on 
  348.         during  Avatar  emulations.   It is best not to  mess  with  this 
  349.         variable  when  using AVT/1 as it is designed primarily  for  use 
  350.         with AVT/0+.
  351.         
  352.         ScrnLines : byte = 25;
  353.         
  354.              This  variable defines the number of lines that you want  on 
  355.         your  terminal  screen.   Modifying  this  variable  can  produce 
  356.         strange  results.  It is recommended that you use the  SetScreen-
  357.         Size procedure to define the screen size.
  358.         
  359.         ScrnColumns : byte = 80;
  360.         
  361.              This  variable is the partner of the above one.  It  defines 
  362.         the number of columns you want on your terminal screen.  The same 
  363.         restrictions apply with this variable as on the above.
  364.         
  365.         QueryReply : string[80] = 
  366.         'AVT1, PAvatar 1.50 Copr. 1991-93 Gregory P. Smith'+^M;
  367.         
  368.              When the Avatar terminal id request is received this is  the 
  369.         string  that will be returned.  The "AVT1," at the  beginning  is 
  370.         important  to  the  remote terminal.  It is used  to  define  the 
  371.         capabilities  of the terminal.  Everything else is just your  own 
  372.         logo  or  program ID.  In level 0+ simulation mode  the  AVT1  is 
  373.         changed  to AVT0.  I would appreciate it if you would  leave  the 
  374.         "PAvatar 1.50" in the string if you do modify it.
  375.         
  376.         Dest_BS : Boolean = True;
  377.         
  378.              As the name implies, this variable controls the behavior  of 
  379.         the backspace (^H) character.  The AVT/1 specifications require a 
  380.         Destructive backspace while the AVT/0 specifications require that 
  381.         it is non-destructive.
  382.         
  383.         Def_Cursor : word = <see text>;
  384.         
  385.              The normal cursor shape (as used by the BIOS call to set the 
  386.         cursor  shape) is stored in this variable.  The Normal cursor  is 
  387.         usually an underscore but the value will vary depending upon what 
  388.         video  card the program is run on.  This variable is set  to  the 
  389.         cursor shape is when the PAvtIO unit initializes at startup.
  390.         
  391.         
  392.         Constants
  393.         ─────────────────────────
  394.         
  395.              The following constants are available for general use in the 
  396.         PAvtIO unit.
  397.         
  398.              Esc = ^[;
  399.              DLE = ^P;
  400.              FS = #28;
  401.              GS = #29;
  402.              RS = #30;
  403.              US = #31;
  404.              SP = #32; { space }
  405.         
  406.         
  407.         User Hooks
  408.         ─────────────────────────
  409.         
  410.              The  interface  for  this unit has been designed  to  be  as 
  411.         flexible  as  possible without hindering the performance  of  the 
  412.         unit.  Other than the main procedures and a few variables most of 
  413.         PAvatar  consists of procedural hooks found in the  PAvtIO  unit.  
  414.         Their definitions follow.
  415.              The  Avatar  interpreter does not check for  invalid  screen 
  416.         coordinates  on the hooks that need them.  It is  important  that 
  417.         your  hooks  check the integrity of  the  coordinates,  otherwise 
  418.         seemingly  random lockups can occur when invalid or garbled  com-
  419.         mands are processed.  All screen coordinates are one based  mean-
  420.         ing that (1,1) is home position.
  421.         
  422.         Query_Hook : ReplyProc = Procedure (S:String);
  423.         
  424.              This hook is used for all terminal queries or responses such 
  425.         as  the Avatar driver query and the ANSI report cursor  position.  
  426.         Usually  these replies will be placed in the keyboard  buffer  or 
  427.         sent  out  the comm port.  In pavtdemo, the hook is left  at  its 
  428.         null procedure setting as there is no use for it in that type  of 
  429.         utility.   Note  that information passed to this hook  should  be 
  430.         inserted  immediately into the input or output buffer so that  it 
  431.         is  the  next thing to be processed if you wish to  comply  fully 
  432.         with the AVT/1 specifications.
  433.         
  434.         WriteATh : WriteATHookT = Procedure (x,y,a:byte;ch:char);
  435.         
  436.              This hook is simple and important.  It should write  charac-
  437.         ter ch on the screen at location x,y using attribute a.  This  is 
  438.         the  only  thing it should do, it should not move the  cursor  or 
  439.         scroll the screen.
  440.         
  441.         GotoXYh : GotoXYHookT = Procedure (x,y:byte);
  442.         
  443.              This  hook is used to set the cursor position.   Often  this 
  444.         routine will call the Crt unit's GotoXY procedure.  It is provid-
  445.         ed  for  flexibility and the possibility of using  PAvatar  in  a 
  446.         virtual  screen or window.  Full checking against  ScrnLines  and 
  447.         ScrnColumns is performed internally.
  448.         
  449.         Scrollh : ScrollHookT = Procedure (dir,x1,y1,x2,y2,n,a:byte);
  450.         
  451.              This  hook is important to Avatar's power.  It  scrolls  the 
  452.         screen  region of (x1,y1)-(x2,y2) n lines in the direction  indi-
  453.         cated  in  dir (1=up, 2=down, 3=left, 4=right).  The  empty  area 
  454.         created by the scroll should be filled with blank spaces of color 
  455.         attribute  a.   Most  good windowing toolkits  have  a  procedure 
  456.         suitable for this.
  457.         
  458.         FillAreah : FillHookT = Procedure (x1,y1,x2,y2,a:byte;ch:char);
  459.         
  460.              This  hook  is used to fill the screen  region  of  (x1,y1)- 
  461.         (x2,y2)  with  character ch in attribute a.   If  your  scrolling 
  462.         procedure  doesn't  support a fill color for  the  newly  exposed 
  463.         area, this is a good procedure to use for it.
  464.         
  465.         GetATh : GetCharHookT = Procedure (x,y:byte;var a:byte;var c:char);
  466.         
  467.              This  hook is the opposite of the WriteATh hook in that  its 
  468.         purpose  is  to retrieve information from the  screen.   Variable 
  469.         parameters  c and a should be set to the character and  attribute 
  470.         at the coordinates of x,y respectively.
  471.         
  472.         HighAreah : HighHookT = Procedure (x1,y1,x2,y2,a:byte);
  473.         
  474.              Similar to FillAreah, this hook fills an area of the screen.  
  475.         The area defined by (x1,y1)-(x2,y2) should be filled with attrib-
  476.         ute a, but the characters on the screen should not be modified.
  477.         
  478.         Pauseh : PauseHookT = Procedure (tenths:word);
  479.         
  480.              The  purpose of this hook is to allow for controlled  system 
  481.         pauses.  This hook should pause the terminal for tenths 10ths  of 
  482.         a  second.  The reason I didn't use a delay(100) within the  unit 
  483.         is  for the protection of the user.  With avatar, codes could  be 
  484.         sent  that could conceivably pause the system for  several  days; 
  485.         the Delay() procedure is also inaccurate in multitaskers.  It  is 
  486.         up  to you to add a method of breaking out of a pause (such as  a 
  487.         key press).
  488.         
  489.         Cursorh : CursorHookT = Procedure (style:byte);
  490.         
  491.              This hook is used to set the cursor shape for the  terminal.  
  492.         Style is one of the constants NormCursor, BigCursor or HiddenCur-
  493.         sor.  Each one should, respectively, set the cursor to the normal 
  494.         underscore  mode, make a block cursor or make the  cursor  invis-
  495.         ible.
  496.         
  497.         FlushInputh : Procedure;
  498.         
  499.              This  hook  has  a default effect of  zeroing  the  keyboard 
  500.         buffer.   If your program has any internal buffers or  communica-
  501.         tions  buffer,  you  may wish to flush them  when  this  hook  is 
  502.         called.  The Avatar flush input command calls this hook.
  503.         
  504.         TTYCharH : Function (ch:char): Boolean;
  505.         
  506.              This hook is called by the AvtTTY procedure with the charac-
  507.         ter  to be processed as a parameter.  If the hook returns  False, 
  508.         AvtTTY  will not process the character.  The default hook  always 
  509.         returns a value of true.
  510.         
  511.         
  512.         Major Changes From 1.17
  513.         ─────────────────────────
  514.         
  515.              You  MUST  call  the InitUnit procedure found  in  the  main 
  516.         PAvatar  unit!   I have made the main unit  overlayable,  meaning 
  517.         that it cannot have an initialization section.
  518.              Use the SetTerminal() procedure to set the unit to emulate a 
  519.         different  terminal.   The old  ANSI_Only  and  Level0_Simulation 
  520.         procedures  are still available but are no longer supported,  and 
  521.         may not exist in future versions.
  522.              I  would like to encourage you to use the TTYCharH  hook  to 
  523.         the  fullest  extent possible.  It gives you access  to  the  raw 
  524.         ASCII  data with the control codes removed.  You can easily  pro-
  525.         cess your own special control codes, make readable log files, and 
  526.         implement scroll back buffers with it.  There is also a new hook, 
  527.         Cursorh, which should change the cursor shape as describe above.
  528.              Starting  with PAvatar 1.50 and above the small  version  of 
  529.         the  unit  has been discontinued.  The main unit is now  just  as 
  530.         fast.   Compiler  defines can be used to eliminate  features  you 
  531.         don't want.
  532.         
  533.         
  534.         Part IV.  Special Considerations
  535.         ──────────────────────────────────────────────────────────────────
  536.         
  537.         Avatar 1 Console
  538.         ─────────────────────────
  539.         
  540.              The  Avatar  level one console is a very  powerful  terminal 
  541.         emulation.  Naturally it goes without saying that there are a few 
  542.         things  that  must be considered if you wish to comply  with  the 
  543.         full  AVT/1 console specifications.  I've already  mentioned  the 
  544.         need  to insert the query replies first into the input or  output 
  545.         buffer.  Secondly, AVT/1 features a sleep mode for its interpret-
  546.         er.  ANSI fallback should not be used with level 1 (but  it  will 
  547.         work);  a remote program using level 1 codes should know  how  to 
  548.         switch between sleeping (ANSI) and awake (AVT/1) modes.
  549.              The  main thing you should be concerned about in  communica-
  550.         tions  is flow control.  AVT/1 has a way to get around  interfer-
  551.         ence with XON/XOFF flow control if the parser is in cooked  mode, 
  552.         but if it's switched to raw mode, the results may be  disastrous.  
  553.         As AVT/0+ is a raw only terminal, XON/XOFF must be disabled while 
  554.         it is active.
  555.  
  556.         Tips & Tricks
  557.         ─────────────────────────
  558.         
  559.              If  your program needs to execute a subprogram or  shell  to 
  560.         DOS  there are some special precautions that you must take.   You 
  561.         must  call the Set_Sound_backg() procedure to restore  the  timer 
  562.         interrupt.     You   should   also   save   the    exitproc    as 
  563.         Set_Sound_backg()  only  restores it to it's  very  first  state.  
  564.         Here is some sample code for a DOS shell:
  565.         
  566.         SavedEP := ExitProc;
  567.         Set_Sound_backg(False);
  568.         SwapVectors;
  569.         Exec(GetEnv('COMSPEC''),'');
  570.         SwapVectors;
  571.         Set_Sound_backg(True);
  572.         ExitProc := SavedEP;
  573.         
  574.         
  575.         Part V.  History And Credits
  576.         ──────────────────────────────────────────────────────────────────
  577.         
  578.              I thank Ping Hansen from the FidoNet Pascal echo and an  un-
  579.         known someone in the FidoNet communications echo for sparking  my 
  580.         interest in terminal emulations and Avatar.  I also would like to 
  581.         thank G. Adam Stanislav for taking on the project of updating the 
  582.         Avatar  specification  past  its original  Opus  level  commands.  
  583.         Thanks  to  Bo  Bendtsen (Author of Terminate)  for  writing  the 
  584.         "ANSI"  music routines.  Last but not least, I thank  my  parents 
  585.         and girlfriend for understanding my love for computers.
  586.         
  587.         Release Sites
  588.         ─────────────────────────
  589.         
  590.              The  following  is a list of BBS's where you  can  find  the 
  591.         latest version of PAvatar as well as contacting me.
  592.         
  593.         (303)779-1634  The Vault, 300-9600, FidoNet: 1:104/332
  594.         (303)750-7136  Borealis WildCat, 1200-14.4k, RIME: ->BOREALIS
  595.         (303)429-9205  Bohemia, 300-14.4k, (Unix: in home/users/gpsmith)
  596.         
  597.              Thanks  goes  to Mark Cook for uncovering most of  the  bugs 
  598.         hiding in the original versions of PAvatar.
  599.         
  600.         ──────────────────────────────────────────────────────────────────
  601.         Send all questions, comments, problems, ideas, money, etc.. to:
  602.         
  603.              Gregory P. Smith
  604.              4422 Pali Way
  605.              Boulder, CO  80301  USA
  606.         
  607.         FidoNet:  1:104/332.11        (To: Gregory P. Smith)
  608.         RIME:   ->BOREALIS            (To: Gregory P Smith)
  609.         UseNet/InterNet: smithgr@ucsu.Colorado.EDU
  610.                    also: gpsmith@bohemia.metronet.org
  611.         CompuServe: Route to an InterNet address.
  612.